'use strict';

import { DataTypes } from 'sequelize'
import sequelize from '../utils/database.js'
import BaseModel from './BaseModel.js'

class SystemRoles extends BaseModel {
  /**
   * Helper method for defining associations.
   * This method is not a part of Sequelize lifecycle.
   * The `models/index` file will call this method automatically.
   */
  static associate(models) {
    // define association here
  }
}
SystemRoles.init({
  name: {
    type: DataTypes.STRING(125),
    unique: true,
    allowNull: false,
    comment: '角色唯一标识'
  },
  display_name: {
    type: DataTypes.STRING(125),
    allowNull: false,
    defaultValue: '',
    comment: '角色名称'
  },
  description: {
    type: DataTypes.STRING(125),
    allowNull: false,
    defaultValue: '',
    comment: '描述'
  },
}, {
  sequelize,
  modelName: 'SystemRoles',
  tableName: 'system_roles'
})

export default SystemRoles
